// bad
function test(color) {
    switch (color) {
        case  'red':
            return ['apple', 'strawberry'];
        case 'purple':
            return ['grape', 'plum']
        default:
            return [];
    }
}


console.log(test('red'));


// good
const fruitColor = {
    red: ['apple', 'strawberry'],
    purple: ['grape', 'plum']
};

console.log(fruitColor['red']||[]);


// better

const  fruitColorMap =new Map()
.set('red',['apple', 'strawberry'])
.set('purple',['grape', 'plum']);

console.log(fruitColorMap.get('red'));